<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script>
        /*
         * Devboot is a temp solution that is used for testing purposes
         * ... (no PHP there ;)). So if anyone wonders whats the
         * "dont-deploy" folder, it contains stuff which are used for
         * development/debugging/internal demo purposes and it should
         * not be deployed to production.
         *
         * The devboot.html also setups the localStorage so that:
         *
         * 0) Clear the localStorage
         *
         * 1) Debug mode is enabled - e.g. a lot of stuff will be
         *    printed in the dev console, via console.* and the
         *    MegaLogger.
         *
         * 2) Static path is dynamically set to ../../ (relative to
         *    dont-deploy/devboot.html). This means that the staticPath
         *    should be correctly set even if you have your project
         *    running in localhost/meganz-webclient/ or customVhost/ +
         *    it will work with http OR https.
         *
         * 3) Will enable the megaChat (<-- major thing, may change a
         *    lot of stuff)
         *
         * 4) Will force the secureboot to load the actual .js files
         *    instead of just pushing ALL javascript files into a single
         *    blog: (this was really helpful for debugging the JS code
         *    using the Chrome debugger).
         *
         * 5) Will enable stopOnAssertFail, which in case of assertion
         *    fail (mainly in the chat.js code) will run a debugger;
         *    (something pretty handy during development)
         */

        var devhost = window.location.host;
        var pathSuffix = window.location.pathname;
        pathSuffix = pathSuffix.split("/").slice(0, -2).join("/");

        localStorage.clear();
        localStorage.staticpath = window.location.protocol + "//" + devhost + pathSuffix + "/";

        // Disable the cryptographic hash verification logic.
        localStorage.dd = '1';
        localStorage.apipath = 'https://staging.api.mega.co.nz/';

        // localStorage.contextmenu = '1';

        localStorage.jj = '1';
        // localStorage.stopOnAssertFail = '1';

        // Turn on full debugging.
        localStorage.d = '1'; // Using console.*
        localStorage.minLogLevel = '0'; // Using MegaLogger, '0' = MegaLogger.LEVELS.DEBUG.
        //localStorage.hashLogic = 1;
        // Chat stuff.
        // localStorage.dxmpp = '1';
        // localStorage.chatDisabled = '1';

        // super simple parsing of GET args to make this an universal localStorage flag setting file
        var urlParsed = window.location.toString().split("?");

        (urlParsed[1] || "").split("&").forEach(function(s) {
            if (!s || !s.length) {
                return;
            }

            var kv = s.split("=");
            var varName = kv[0];
            var val = kv[1];
            if (!val) {
                val = "1";
            }
            localStorage[varName] = val;
        });

        // Add ?apipath=staging to the end of the URL if you want to
        // use the staging API, apipath=prod for the live API servers,
        // or leave blank for Sandbox 3.
        if (window.location.search.indexOf('apipath=staging') > -1) {
            localStorage.apipath = 'https://staging.api.mega.co.nz/';
            localStorage.enableAllPaymentGateways = '1';
        }
        else if (window.location.search.indexOf('apipath=prod') > -1) {
            localStorage.apipath = 'https://eu.api.mega.co.nz/';
        }
        else if (window.location.search.indexOf('apipath=sandbox2') > -1) {
            localStorage.apipath = 'https://api-sandbox2.developers.mega.co.nz/';
        }
        else     {
            localStorage.apipath = 'https://api-sandbox3.developers.mega.co.nz/';
        }

        // Use the beta CMS if requested
        if (window.location.search.indexOf('betacms=1') > -1) {
            localStorage.cms = 'https://cms2.systems.mega.nz/';
        }

        // Force viewing of the mobile site if requested
        if (window.location.search.indexOf('mobile=1') > -1) {
            localStorage.testMobileSite = '1';
        }

        // Some flags for testing the Open in App feature on mobile
        if (window.location.search.indexOf('testOpenInApp=ios') > -1) {
            localStorage.testOpenInApp = 'ios';
        }
        else if (window.location.search.indexOf('testOpenInApp=android') > -1) {
            localStorage.testOpenInApp = 'android';
        }
        else if (window.location.search.indexOf('testOpenInApp=winphone') > -1) {
            localStorage.testOpenInApp = 'winphone';
        }

        // Use old URL hash logic for everything e.g. mega.nz/#blog instead of mega.nz/blog
        if (window.location.search.indexOf('hashLogic') > -1) {
            localStorage.hashLogic = 1;
        }


        window.location = '../';

    </script>
</head>
<body>

</body>
</html>
